<base href="<?php echo base_url();?>" />
<link rel="stylesheet" href="assets/style.css" type="text/css" media="screen"/>

<table>
	<thead>
	    <tr>
	      <th>ID</th>
	      <th>Fragenart</th>
	      <th>Frage</th>
	      <th>Antwort 1</th>
	      <th>Antwort 2</th>
	      <th>Antwort 3</th>
	      <th>Antwort 4</th>
	      <th>Antwort 5</th>
	      <th>Lösung 1</th>
	      <th>Lösung 2</th>
	      <th>Lösung 3</th>
	      <th>Punkte</th>
	      <th>Bearbeiten</th>      
	    </tr>
  	</thead>
	<tbody > 
		<?php foreach ($fragen as $row): ?>
		<tr>
	        <td><?php echo $row['ID'];?></td>
	        <td><?php echo $row['Fragenart'];?></td>
	        <td><?php echo $row['Frage'];?></td>
	        <td><?php echo $row['Antwort1'];?></td>
	        <td><?php echo $row['Antwort2'];?></td>
	        <td><?php echo $row['Antwort3'];?></td>
	        <td><?php echo $row['Antwort4'];?></td>
	        <td><?php echo $row['Antwort5'];?></td>
	        <td><?php echo $row['Loesung1'];?></td>
	        <td><?php echo $row['Loesung2'];?></td>
	        <td><?php echo $row['Loesung3'];?></td>
	        <td><?php echo $row['Punkte'];?></td>
	        <td>
		        <?php $this->load->helper(array('form')); ?>
		    	<?php echo validation_errors(); ?>
				<?php echo form_open('fragen_controller/validate_view')?>
				<input type="input" name="fragenid" hidden="true" value=<?php echo $row['ID'];?>  />
	        	<input type='submit' name='submit' value='Ändern' > 	       
	        </td>
	 		</form>        
	    </tr>
		<?php endforeach; ?>
	</tbody>
</table>
<?php $this->load->helper(array('form')); ?>
<?php echo validation_errors(); ?>
<?php echo form_open('fragen_controller/create_view')?>
<input type='submit' name='submit' value='Neue Frage' > <br /> <br />
</form>

<!--    ######################################   -->

<?php
$this->load->helper(array('form'));
echo validation_errors(); 
echo form_open('klausurenfragen_controller/set_klausurfragen');
echo "<input type='input' name='klausurenid' hidden='true' value='".$klausurenid."'/>";
echo "<table>
		<thead>
	    	<tr>
		      	<th>Fragenr. </th>
		      	<th>Fragen ID </th>
	    	</tr>
		</thead>
		<tbody>";
			$a = 1;
			foreach($klausurenfragen as $row):
	  echo "<tr>
				<td>".$a." </td>
				<td>";
				echo "<input type='input' name='fragenid[".$a."]' value='".$row['FragenID']."'/><br />";				
		   echo"</td>
			</tr>";
			$a++;
			endforeach;
			for($i = $a; $i <= $anzahlfragen; $i++):
	  echo "<tr>
				<td>".$i." </td>
				<td>";
				echo "<input type='input' name='fragenid[".$i."]' /><br />";				
		   echo"</td>
			</tr>";
			endfor; 
 echo "</tbody>
	</table>";


echo "<input type='submit' name='submit' value='Fragen Speichern' > <br /> <br />
	 </form>";

?>
